package com.bclz.environment;


import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Partitioner;

public class EnvironmentPartitioner extends Partitioner<Environment,IntWritable> {

    @Override
    public int getPartition(Environment environment, IntWritable intWritable, int numPartitions) {

        return (environment.getYearAndMonth().hashCode()&Integer.MAX_VALUE)%numPartitions;
    }
}
